<?xml version="1.0" encoding="utf-8"?>
<!-- this is an included stylesheet that defines the buttons on most of the pages -->
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

<!-- write the buttons (actually, links) across the top of the page in 
	 a div across the top -->
<xsl:template name="writeTopButtons">
<!-- if writeSave is 1 then write the save and revert buttons -->
<xsl:param name="writeSave"/>
<!-- specifies the name of the disabled button (there is always one) -->
<xsl:param name="disabled"/>
<!--logo-->
<p class="header">
<span class="phaidros">
	<xsl:text disable-output-escaping="yes">
		<![CDATA[&#934;&#913;&#921;&#916;&#929;&#927;&#931;]]> 
	</xsl:text>
</span>
<!-- home -->
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/Home')</xsl:with-param>
	<xsl:with-param name="label">HomeButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<!-- view versions and edit versions -->
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/ViewVersions')</xsl:with-param>
	<xsl:with-param name="label">VersionsButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/EditVersions')</xsl:with-param>
	<xsl:with-param name="label">EditVersionsButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<!-- single view and edit single view -->
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/SingleView')</xsl:with-param>
	<xsl:with-param name="label">SingleViewButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/EditView')</xsl:with-param>
	<xsl:with-param name="label">EditSingleViewButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<!-- twin view and edit twin view -->
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">redirect('/Alpha/TwinView')</xsl:with-param>
	<xsl:with-param name="label">TwinViewButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">notImplemented()</xsl:with-param>
	<xsl:with-param name="label">EditTwinViewButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<!-- facsimile view and edit facsimile view -->
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">notImplemented()</xsl:with-param>
	<xsl:with-param name="label">FacsimileViewButton</xsl:with-param>
</xsl:call-template>
<span class="header"> | </span>
<xsl:call-template name="writeButton">
	<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
	<xsl:with-param name="script">notImplemented()</xsl:with-param>
	<xsl:with-param name="label">EditFacsimileViewButton</xsl:with-param>
</xsl:call-template>
<!-- save and revert -->
<xsl:if test="$writeSave=1">
	<span class="header"> | </span>
	<xsl:call-template name="writeButton">
		<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
		<xsl:with-param name="script">save()</xsl:with-param>
		<xsl:with-param name="label">SaveButton</xsl:with-param>
	</xsl:call-template>
	<span class="header"> | </span>
	<xsl:call-template name="writeButton">
		<xsl:with-param name="disabled"><xsl:value-of select="$disabled"/></xsl:with-param>
		<xsl:with-param name="script">revert()</xsl:with-param>
		<xsl:with-param name="label">RevertButton</xsl:with-param>
	</xsl:call-template>
</xsl:if>
</p>
</xsl:template>

<!-- write one button -->
<xsl:template name="writeButton">
	<!-- name of the button to disable -->
	<xsl:param name="disabled"/>
	<!-- url to redirect to -->
	<xsl:param name="script"/>
	<!-- label for button -->
	<xsl:param name="label"/>
	<button type="submit">
		<xsl:if test="$disabled!=$label">
			<xsl:attribute name="class">enabled</xsl:attribute>
			<xsl:attribute name="onclick">
				<xsl:value-of select="$script"/>
			</xsl:attribute>
		</xsl:if>
		<xsl:if test="$disabled=$label">
			<xsl:attribute name="class">disabled</xsl:attribute>
			<xsl:attribute name="disabled">disabled</xsl:attribute>
		</xsl:if>
		<xsl:value-of select="*/strings/string[@name=$label]/@value"/>
	</button>
</xsl:template>

</xsl:stylesheet>